<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>基本信息</title>
	    <script src="__INDEX__/js/mui.min.js"></script>
	<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
	<link rel="stylesheet" href="__INDEX__/css/style.css" />
	<link rel="stylesheet" href="__INDEX__/css/mall.css" />	
</head>

<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		<h1 class="mui-title">基本信息</h1>
	</header>
	<div class="mui-content">
		<ul class="step_nav">
			<li class="active">
				<p class="nam">第1步</p>
				<p class="nr">基本信息</p>
			</li>
			<li class="iconfont icon-jiantou4"></li>
			<li>
				<p class="nam">第2步</p>
				<p class="nr">注册信息</p>
			</li>
			<li class="iconfont icon-jiantou4"></li>
			<li>
				<p class="nam">第3步</p>
				<p class="nr">结算信息</p>
			</li>
			<li class="iconfont icon-jiantou4"></li>
			<li>
				<p class="nam">第4步</p>
				<p class="nr">照片资料</p>
			</li>
		</ul>
		<form  id="my_form" method="POST">  
		<ul class="mui-table-view step3_list">
			 <li class="mui-table-view-cell">
		        <label><em>*</em>微信号</label>
		        <input type="text" name="wechat_no" value="{$qy.wechat_no}" class="mui-input-group" placeholder="微信账号(注意:不是手机号码在微信中点击我查看见下图)" style="border: 0;" />
		    </li>
		    <div>
		    	<img src="__INDEX__/images/x8.png" />
		    </div>
		     <div class="mui-table-view-cell"><em style="color: red;">微信要求已绑定银行卡完成实名认证，且实名认证的姓名与所填写的联系人姓名账号名相同</em></div>
		    <li class="mui-table-view-cell">
		        <label><em>*</em>商户全称</label>
		        <input type="text" name="agent_name1" value="{$qy.agent_name1}" class="mui-input-group" placeholder="请输入商户全称" style="border: 0;" />
		    </li>
		     <li class="mui-table-view-cell">
		        <label><em>*</em>商户简称</label>
		        <input type="text" class="mui-input-group" value="{$qy.agent_name2}" name="agent_name2" placeholder="请输入商户简称" style="border: 0;" />
		    </li>
		    <li class="mui-table-view-cell">
		       <label><em>*</em>行业分类</label>
		        <select id="trade_type" onchange="select_trade(this);" name="trade_type" style="display: inline-block;width: 70%; padding-left: 0; font-size: .8rem;" >
		        	<option value="0">选择行业</option>
		        	{foreach name="types" item="tp"}
						<option value="{$tp.id}">{$tp.type_name}</option>
					{/foreach}
					</select>	
		    </li>
		     <li class="mui-table-view-cell">
		       <label><em>*</em>行业二级分类</label>
		        <select id="trade_type2"  name="trade_type2" style="display: inline-block;width: 70%; padding-left: 0; font-size: .8rem;" >
		        	{if $type2}
		        	<option value="{$type2['id']}">{$type2['type_name']}</option>
		        	{else}
		        	<option value="0">选择行业</option>
		        	{/if}
					</select>	
		    </li>
		     <li class="mui-table-view-cell">
		        <label><em>*</em>经营地址</label>
		        <input type="text" name="address" value="{$qy.address}" class="mui-input-group" placeholder="请填写店铺地址" style="border: 0;" />
		    </li>
		    <li class="mui-table-view-cell">
		        <label><em>*</em>客服电话</label>
		        <input type="text" name="service_tel" value="{$qy.service_tel}" class="mui-input-group" placeholder="请填写客户电话" style="border: 0;" />
		    </li>
		     <li class="mui-table-view-cell">
		        <label><em>*</em>联系人</label>
		        <input type="text" name="contacts" value="{$qy.contacts}" class="mui-input-group" placeholder="请填写联系人" style="border: 0;" />
		    </li>
		    <li class="mui-table-view-cell">
		        <label><em>*</em>联系人职务</label>
		        <input type="text" name="job" value="{$qy.job}" class="mui-input-group" placeholder="请填写联系人职务" style="border: 0;" />
		    </li>
		     <li class="mui-table-view-cell">
		        <label><em>*</em>联系电话(登录使用)</label>
		        <input type="text" name="contact_tel" value="{$qy.contact_tel}" class="mui-input-group" placeholder="请填写联系电话" style="border: 0;" />
		    </li>
		     <li class="mui-table-view-cell">
		        <label><em>*</em>邮箱</label>
		        <input type="text" name="email" value="{$qy.email}" class="mui-input-group" placeholder="请填写联系邮箱" style="border: 0;" />
		    </li>
		   
		   
		   </br>
		</ul>
		
		<button class="qiany_btn" type="button">下一步</button>
		</form>
	</div>
</body>

</html>
{include file="public/footer" /}
<script>
	function select_trade(obj){
		var trade_id=$(obj).val();
		var lay = layer.load(0, {shade: false,time: 1.5 * 1000});
		$.ajax({
				type: 'post',
				url: 'get_trades',
				data: {
					trade_id:trade_id
				},
				success: function(data) {
					var list=data.data;
					if(list){
						var html="<option value='0'>选择行业</option>";
						for(var i=0;i<list.length;i++){
							var trade=list[i];
							html+="<option value="+trade['id']+">"+trade['type_name']+"</option>";
						}
						$("#trade_type2").html(html);

					}
				}
		})
		
	}
	$("#trade_type").val('{$qy.trade_type}');
	$("#trade_type2").val('{$qy.trade_type2}');
	$(".qiany_btn").click(function(){
		if($("input[name='agent_name1']").val()==''){
			layer.msg("请输入商户全称");
			return;
		}
		if($("input[name='agent_name2']").val()==''){
			layer.msg("请输入商户简称");
			return;
		}
		if($("select[name='trade_type']").val()==0){
			layer.msg("请选择行业分类");
			return;
		}
		if($("select[name='trade_type2']").val()==0){
			layer.msg("请选择行业二级分类");
			return;
		}
		if($("input[name='address']").val()==''){
			layer.msg("请输入店铺经营地址");
			return;
		}
		if($("input[name='service_tel']").val()==''){
			layer.msg("请输入客服电话");
			return;
		}
		if($("input[name='contacts']").val()==''){
			layer.msg("请输入日常联系人");
			return;
		}
		if($("input[name='job']").val()==''){
			layer.msg("请输入联系人职务");
			return;
		}
		if($("input[name='contact_tel']").val()==''){
			layer.msg("请输入联系人电话");
			return;
		}
		if($("input[name='email']").val()==''){
			layer.msg("请输入邮箱");
			return;
		}
		$.ajax({
				type: 'post',
				url: 'step3',
				data: $('#my_form').serialize(),
				success: function(data) {
							location.href = "{:url('step4')}";
				}
			})
	

	})
</script>